<?php if (!defined("_ECRIRE_INC_VERSION")) return;

require_once(_DIR_PLUGIN_ECATALOGUE.'classes/class.GroupeModel.php');
require_once(_DIR_PLUGIN_PDK.'classes/forms/class.PdkListEditor.php');
//include_once(_DIR_PLUGIN_PDK.'functions/pdk_database.php');

function formulaires_ecatalogue_groupes_traiter_dist() {
    $result = array();
        
    $mdl = new GroupeModel();
    $list_editor = new PdkListEditor($mdl);    
    $flag_result = $list_editor->EditElements(_request('elements_update'), 
                                              _request('elements_insert'), 
                                              _request('elements_delete'));
    
    if ($flag_result) {
        $result['message_ok'] = _T('ecatalogue:form_saved');
    } else {
        $result['message_erreur'] = _T('ecatalogue:form_error');
    }
    
    return $result;    
}

?>